﻿using TouchSocket.Sockets;

namespace TK.TSocket
{
    /// <summary>
    /// 数据包
    /// </summary>
    public class DataPacket
    {
        /// <summary>
        /// 数据类型
        /// </summary>
        public DataType DataType { get; set; }

        /// <summary>
        /// 服务端IP
        /// </summary>
        public string ServerIp { get; set; }

        /// <summary>
        /// 服务端口
        /// </summary>
        public int ServerPort { get; set; }

        /// <summary>
        /// 客户端IP
        /// </summary>
        public string ClientIp { get; set; }

        /// <summary>
        /// 客户端端口
        /// </summary>
        public int ClientPort { get; set; }

        /// <summary>
        /// 客户端唯一码
        /// </summary>
        public string ClientId { get; set; }

        /// <summary>
        /// 数据返回，二选一返回;用null判断
        /// </summary>
        public byte[] Data { get; set; }

        /// <summary>
        /// 自定义解析器数据,二选一返回;用null判断
        /// </summary>
        public IRequestInfo RequestInfo { get; set; }

        /// <summary>
        /// 其他消息，一般为非数据接收时
        /// </summary>
        public string Message { get; set; }
    }
}
